import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/loginPage.vue')
    },
    {
      path: '/',
      name: 'index',
      component: () => import('@/views/layoutView.vue'),
      children: [
        {
          path: '/menuList',
          name: 'menuList',
          component: () => import('@/views/system/menuList.vue')
        }
      ]
    }
    // {
    //   path: '/mock',
    //   name: 'mock',
    //   component: () => import('../views/mockView.vue'),
    // }
  ]
})

// 路由守卫
// router.beforeEach((to, from) => {
//   console.log(to, 111)
//   console.log(from, 111)
// })

export default router
